Repository navigation
feat(spec): Studio metadata-form select choices are translatable (metadataForms options slot) - #37569
objectstack-fleet[bot] wants to merge 4 commits into
Conversation
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2f884875451523b240e3c26a799abcd62a6b535d && git checkout 2f884875451523b240e3c26a799abcd62a6b535d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 411646562566a1e12b4e0fc3de256192e8302719 8f1f70ffa5c34c3c708669cbf2ccf73ddbfdf324 && git checkout -B drift-repro 411646562566a1e12b4e0fc3de256192e8302719 && git merge --no-ff 8f1f70ffa5c34c3c708669cbf2ccf73ddbfdf324
node scripts/docs-audit/affected-docs.mjs --json 411646562566a1e12b4e0fc3de256192e8302719
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Re-run once · 2026-11-26T14:10Z · head 8f1f70f · run 45830682855 One red on this head: Test Core (5/10), job 139947827254. The failing case is The seat judges this a flake, for three reasons:
So the failed jobs are re-run once through the relay. If the case fails a second time, that is a real red and the area thread chases the cause. |
Requested by Sales · project thread
Fixes #36950
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none —
skills/objectstack-i18n/SKILL.mdnames themetadataFormsgroup only, never its leaf keys; the group is platform-owned, so no app author writes the new key维护者速读
What changes
The reading the card asked for (at
021524cd,METADATA_FORM_REGISTRYwalked with the extractor's path rule): of the 18 registered Studio forms, 9 carry a select row withoptions—object,field,hook,report,dashboard,action,page,agent,skill— 38 rows, 187 options (185 distincttype.path.valuekeys:object'sfields.deleteBehavioris listed twice, with the same names). Every one is seen by a builder: the console'sSchemaFormrendersfieldSpec.optionsahead of the schema enum (ui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsx, the enum/select branch), and the server translated onlylabel,helpTextandplaceholderof a form field.packages/spec/src/system/translation.zod.ts). AmetadataForms.<type>.fields.<path>entry acceptsoptions: a record from optionvalueto its translated name, the shapeobjects.<object>.fields.<field>.optionsalready has.choicesandvaluesare its aliases, as on the object-field face.packages/spec/src/system/i18n-resolver.ts).translateFormFieldoverlays eachoptions[]entry'slabelwith the translation keyed by itsvalue, along the locale chain; an option with no translation, or with a non-string value, is passed through unchanged. This is the walkerresolveMetadataFormLabelsuses, which/api/v1/meta/typeslocalizes served forms with.packages/lint/src/i18n-walk.ts).walkFormFieldemitsmetadataForms.<type>.fields.<path>.options.<value>for every option of a row, seeded with its English label, soos i18n extractandpnpm check:i18noffer exactly the keys the resolver reads.node scripts/check-i18n-bundles.mjs --writeadded the 185 keys to all eleven*.metadata-forms.generated.tspacks; the ten translated packs then got hand-written names (ar, de, es-ES, fr, ja-JP, ko, pt-BR, ru, zh-CN, zh-Hant) and a second--writedropped every source-hash row they had seeded. The 17 Default Period choices take the wording of the console's own period chip (ui/packages/i18n/src/locales/*,dashboard.filters.range.*anddashboard.filters.custom), so the period an author picks reads as the period a viewer sees. Loanwords that read the same as English (URL,HTML,JSON,Markdown, and per locale words such as deText, frDate) are spelled so they are not byte-echoes of the source, which the catalog's zero-echo pins require (object-lifecycle-panel-echo-decisions.test.ts,report-form-echo-decisions.test.ts): for example zh-CN网址(URL), deTextfeld, frDate (sans heure).content/docs/references/system/translation.mdxregenerated (gen:docs).Small calls made here (no card): the alias pair
choices/valuesmirrors the object-field face; a non-string option value is passed through untouched rather than stringified, since every option a registered form lists has a string value (the reading found none other).Why
A non-English builder saw a translated field label with English choices under it on every server-rendered Studio form. The bundle had no slot for the names, so no locale could fix it.
Verification
packages/spec/src/system/i18n-resolver.test.ts, new top-level describe "select option names": a choice is renamed by its value and keeps its other keys; a value with no translation keeps its English label; a nested repeater row is reached by its dot path; the input form is not mutated.packages/platform-objects/src/metadata-translations/form-option-labels.test.ts(new): through the SERVED bundle and the real registry, the object form's sharing model reads私有 — 仅所有者in zh-CN; the reading floor (≥30 option rows over ≥8 forms) holds; for each of the ten translated locales every choice of every form select has a non-empty name that differs from its English label.packages/specfull suite green (vitest, 618 s);packages/lint236 files / 9,680 tests green;packages/platform-objectstranslations + metadata-translations 29 files green;packages/clitest/i18n-extract.test.tsgreen;node scripts/check-i18n-bundles.mjsexit 0;pnpm check:i18n-coveragecould not measure here (exit 3: the example apps are not built in this worktree), so CI carries that one;pnpm --filter @objectstack/spec check:generatedexit 0 aftergen:docs.node scripts/pm/overlap-check.mjsexit 0 againstorigin/mainand the open PRs sharing these files (feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types #37422, refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366).Contract review (L2) is owed before landing: the diff changes
packages/spec/src/**and declaresClause-②: yes (widening). Changed lines exceed 3,000, so landing needs an authorized approval.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
Generated by Claude Code